<?php
$name='name'.$this->session->userdata['data_language'];
$content='description'.$this->session->userdata['data_language'];

$post_name='subject'.$this->session->userdata['data_language'];

?>
<div class="main-l fll">
	<div class="breakcrum ov-h clb">
    	<div class="title">
    		<span>
    			<a href="<?php echo base_url();?>home" class="home"><?php echo $this->lang->line('system_home'); ?></a>
    			<!--<a href="<?php echo base_url();?>categories"><?php echo $this->lang->line('system_news'); ?></a>-->
    			<?php if (isset($detail)) { ?>
    			<a href="<?php echo base_url();?>categories/detail/<?php echo $detail->id; ?>"><?php echo $detail->$name; ?></a>
    			<?php } else {?>
    			<a href="<?php echo base_url();?>categories/recruitment"><?php echo $this->lang->line('system_recruitment'); ?></a>
    			<?php } ?>
    		</span>
    	</div>
    </div>
    <div class="detail-other ul-none ul-hot clb ov-h" style="border-bottom:1px solid #CCCCCC;">
    	<h3><?php echo $this->lang->line('system_posts'); ?></h3>
    	<ul style="padding-left:25px">
    	<?php
    		foreach ($posts as $post){
		?>
			<li><a href="javascript:void(0);" onclick="viewPost('<?php echo $post->id; ?>');"><?php echo $post->$post_name; ?></a></li>
		<?php
    		}
    	?>
        </ul>
    </div>
    <div class="clb"></div>
    
    <div class="detail mb-15 clb ov-h" id="div_post_content" style="padding-top:15px">
    	<?php if (isset($detail)) { ?>
    	<h3 class="detail-t"><?php echo $detail->$name; ?></h3>
        <!--<img src="images/img.png" class="detail-thumb fll" />-->
		<?php echo $detail->$content; ?>
		<?php } ?>
    </div>
	
</div>

<script type="text/javascript">
function viewPost(id){
$.post(
		"<?php echo base_url ();?>categories/postDetail/"+id,
		function(data){
			$('#div_post_content').html(data);
		}
	);
}
</script>